package com.test.component;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Author：徐志荣
 * @Date：2023/6/11 下午 3:28
 */

//@Component
public class BeanLifeComponent implements BeanNameAware {

    @Override
    public void setBeanName(String s) {
        System.out.println("执行了 通知");
    }
    @PostConstruct
    public void postConstruct(){
        System.out.println("执行了 PostConstruct");
    }
    public void init(){
        System.out.println("执行了 init 方法");
    }
    @PreDestroy
    public void preDestroy(){
        System.out.println("执行了 销毁 方法");
    }




}
